home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
hard
/
drivr
/
addspeed.lha
/
AddSpeed.s
< prev
next >
Wrap
Text File
|
1992-02-08
|
4KB
|
264 lines
* Written By Niklas Sjöberg, 2:203/415.3
* Exitlevels :
* NO-DOS Equ 30
* NO Adspeed Equ 5 Equ No FAST-mem
* Failed to switch Equ 10
* Assemble with GenAm version 3.
opt NOCHKPC
OUTPUT ram:AddSpeed
include include:IDir.i
include "exec/memory.i"
include "exec/exec_lib.i"
include "libraries/dos_lib.i"
include "libraries/dos.i"
include "include:misc/easystart.i" ; WB-startup.
Print MACRO
lea \1(PC),a1
lea \1_end(PC),a2
suba.l a1,a2
move.l a1,d2 ;buf
move.l a2,d3 ;len
tst.l winhd
beq \@
move.l winhd(PC),d1
bra \@w
\@ CALLDOS Output
move.l d0,d1
\@w CALLDOS Write
ENDM
Upper MACRO
moveq #\2,d0
subq.w #1,d0
move.l a3,-(SP)
konv
cmp.b #97,(\1)
blo ut_k
cmp.b #122,(\1)
bhi ut_k
sub.b #32,(a3)
ut_k move.b (a3)+,d1
dbf d0,konv
move.l (SP)+,a3
ENDM
Bold MACRO
dc.b $9b,'1;31;40m'
ENDM
Norm MACRO
dc.b $9b,'0;31;40m'
ENDM
** EXEC LIBRARY
Exec Equ $00000004
OpenLib Equ -408
** DOS LIBRARY
Open Equ -30
Close Equ -36
Read Equ -42
Write Equ -48
Input Equ -54
Output Equ -60
Seek Equ -66
Delay Equ -198
Execute Equ -222
** DOS STUFF
Mode_Old Equ 1005
Mode_New Equ 1006
Mode_Read_Write Equ 1004
Dos_Secs Equ 60 *1/60 of secs
**********************************************************************
start move.l d0,d6 ;len
move.l a0,a3 ;start
CALLEXEC Forbid
moveq #0,d0
lea Dosname(PC),a1
CALLEXEC OpenLibrary
tst.l d0
bne ok_dos
moveq #30,d0
bra err
ok_dos move.l d0,_DOSBase
Print About
tst.l returnMsg
beq from_CLI
move.l #win,d1
move.l #MODE_OLDFILE,d2
CALLDOS Open
tst.l d0
beq err
move.l d0,winhd
lea foo(pc),a3
moveq #0,d1
bsr speed_test
cmp.w #$1500,d1
bhs off
move.w #'ON',(a3)
bra from_CLI
off move.w #'OF',(a3)
from_CLI
moveq #MEMF_FAST,d1
CALLEXEC AvailMem
bne fastmem_ok
Print need_fast
moveq #5,d0
bra err
fastmem_ok
moveq #0,d1
bsr speed_test
cmp.w #$1500,d1
blo.s p_slow
Print run_14
bra test_par
p_slow Print run_7
test_par subq.w #1,d6
bne par_ok
wrong_par Print par
bra out
par_ok Upper a3,2
moveq #0,d6
cmp.w #'ON',(a3)
bne no_on
moveq #1,d6 ;on
no_on cmp.w #'OF',(a3)
bne no_off
moveq #2,d6
no_off tst.b d6
beq wrong_par
moveq #0,d1
bsr speed_test
cmp.w #$1500,d1
blo slow
move.w #0,$b10000 ;Turn AdSpeed OFF and test
move.l d1,d2
moveq #0,d1
bsr speed_test
move.w #0,$b00000 ;Restore
sub.w d1,d2
cmp.w #1000,d2
bhi Adspeed_Installed
Print no_ad
moveq #5,d0
bra err
slow move.l d1,d2
move.w #0,$b00000 ;Turn AdSpeed ON and test
moveq #0,d1
bsr speed_test
move.w #0,$b10000 ;Restore
sub.w d2,d1
cmp.w #1000,d1
bhi Adspeed_Installed
Print no_ad
moveq #5,d0
bra err
Adspeed_Installed
cmp.b #1,d6 ;ON?
bne not_on
Print on_14
move.w #0,$b00000
moveq #0,d1
bsr speed_test
cmp.w #$1500,d1
bhi not_off
Print fail_14
moveq #10,d0
bra err
not_on cmp.b #2,d6 ;OFF
bne not_off
Print on_7
move.w #0,$b10000
moveq #0,d1
bsr speed_test
cmp.w #$1500,d1
blo not_off
Print fail_7
moveq #10,d0
bra err
not_off
out moveq #0,d0
err CALLEXEC Permit
tst.l winhd
beq no_close
moveq #2*50,d1
CALLDOS Delay
move.l winhd(pc),d1
CALLDOS Close
no_close rts
speed_test cmp.b #$01,$dff006
bne.s speed_test
cnt addq.w #1,d1
cmp.b #$fd,$dff006
bne.s cnt
rts
_DOSBase dc.l 0
Dosname DOSNAME
even
About Bold
dc.b 'Speed (c) 1992 by Niklas Sjöberg, reachable via 2:203/415.3@Fidonet.',10,13
Norm
About_end
par dc.b 'Usage: Speed [ON/OFF]',10,13
par_end
no_ad dc.b 'You have no AdSpeed!!',10,13
no_ad_end
fail_14 dc.b 'Failed to switch to 14 Mhz!',10,13
fail_14_end
fail_7 dc.b 'Failed to switch to 7 Mhz!',10,13
fail_7_end
on_14 dc.b 'Switching into 14 Mhz mode (wroom)',10,13
on_14_end
on_7 dc.b 'Swtiching into 7 Mhz mode (sigh!)',10,13
on_7_end
run_14 dc.b 'State: 14 Mhz',10,13
run_14_end
run_7 dc.b 'State: 7 Mhz',10,13
run_7_end
need_fast dc.b 'Need fastmem! AdSpeed makes no differnce'
dc.b ' otherwise!',10,13
need_fast_end
win dc.b 'CON:10/10/400/100/AdSpeed Window',0
even
winhd dc.l 0
foo ds.w 1